package org.eclipse.emf.extensions.mysql;

import org.eclipse.emf.extensions.DBTypeProvider;

public class MySQLTypeProvider extends DBTypeProvider {
    public static final MySQLTypeProvider INSTANCE=new MySQLTypeProvider();

    //    private static final SimpleDateFormat MYSQL_DATE_FORMAT=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //$NON-NLS-1$

    private MySQLTypeProvider() {
    }

    @Override
    public String getStringType() {
        return "LONGTEXT"; //$NON-NLS-1$
    }

    @Override
    public String getBooleanType() {
        return "TINYINT(1)"; //$NON-NLS-1$
    }

    @Override
    public String getIntType() {
        return "INT(11)"; //$NON-NLS-1$
    }

    @Override
    public String getLongType() {
        return "BIGINT(20)"; //$NON-NLS-1$
    }

    @Override
    public String getFloatType() {
        return "FLOAT"; //$NON-NLS-1$
    }

    @Override
    public String getDoubleType() {
        return "DOUBLE"; //$NON-NLS-1$
    }

    @Override
    public String getByteArrayType() {
        return "LONGBLOB"; //$NON-NLS-1$
    }

    @Override
    public String getDateType() {
        return "TIMESTAMP"; //$NON-NLS-1$
    }

    @Override
    public String getClassNameType() {
        return "VARCHAR(256)"; //$NON-NLS-1$
    }

    //    @Override
    //    public Object wrap(Object value) {
    //        if (value instanceof Timestamp) {
    //            return Long.toString(System.currentTimeMillis() /* ((Timestamp) value).getTime() */);
    //        }
    //        return super.wrap(value);
    //    }
}
